# #面对对象编程
# 题目一：需求编程
# i.定义了一个学生类：属性:学号，姓名，年龄，性别，身高，体重，成绩，家庭地址，电话号码。行为：学习（要求参数传入学习的时间），
# 玩游戏（要求参数传入游戏名），编程（要求参数传入写代码的行数），数的求和（要求参数用变长参数来做，返回求和结果）



#
# class Student:
#     def __init__(self, student_id, name, age, gender, height, weight, score, address, phone_number):
#         self.student_id = student_id
#         self.name = name
#         self.age = age
#         self.gender = gender
#         self.height = height
#         self.weight = weight
#         self.score = score
#         self.address = address
#         self.phone_number = phone_number
#
#     def __str__(self):
#         return f"学号: {self.student_id}, 姓名: {self.name}, 年龄: {self.age}, 性别: {self.gender}, " \
#                f"身高: {self.height}, 体重: {self.weight}, 成绩: {self.score}, " \
#                f"地址: {self.address}, 电话: {self.phone_number}"
#
#
#     def stu_time(self,t):
#         print('学习时间',t)
#
#     def play_game(self,s):
#         print('游戏名称',s)
#
#     def bian(self,n):
#         print('代码的行数',n)
#
#     def sum_n(self, *n):
#         sum = 0
#         for i in n:
#             sum += i
#         return sum




# ii.车类：属性：车型号，车轮数，车身颜色，车重量，油箱存储大小 。功能：跑（要求参数传入车的具体功能，比如越野，赛车）
# 创建：法拉利，宝马，铃木，五菱，拖拉机对象

# class Car:
#     vehicle = ''
#     wheel = 0
#     body = ''
#     weight = 0
#     fuel_tank = 0
#
#     def play(self,s):
#         print(s)
#     def __init__(self,vehicle,wheel,body,weight,fuel_tank):
#         self.vehicle = vehicle
#         self.wheel = wheel
#         self.body = body
#         self.weight = weight
#         self.fuel_tank = fuel_tank
#
#
# car1 = ('法拉利', 4, '白色', 5000, 500)
# car2 = ('宝马', 4, '白色', 5000, 500)
# car3 = ('铃木', 4, '白色', 5000, 500)
# car4 = ('五菱', 4, '白色', 5000, 500)
# car5 = ('拖拉机', 4, '白色', 5000, 500)
#
# print(car1)
#
#
# # iii.笔记本：属性：型号，待机时间，颜色，重量，cpu型号，内存大小，硬盘大小。  行为：打游戏（传入游戏的名称）,办公。
#
# class Pc:
#     id = ''
#     time = ''
#     colour = ''
#     weight = 0
#     cpu = ''
#     memory = 0
#     hard_disk = 0
#
#     def __init__(self, id, time, colour, weight, cpu, memory, hard_disk):
#         self.id = id
#         self.time = time
#         self.colour = colour
#         self.weight = weight
#         self.cpu = cpu
#         self.memory = memory
#         self.hard_disk = hard_disk
#
#     def play(self, s):
#         print(s)
#
#     def offer(self, s):
#         pass
#
# # iv.猴子类：属性：类别，性别，身体颜色，体重。行为：造火（要求传入造火的材料：比如木棍还是石头），
# # 学习事物（要求参数传入学习的具体事物，可以不止学习一种事物）
#
# class Monkey:
#     category = ''
#     sex = ''
#     body = ''
#     weight = ''
#
#     def __init__(self, category, sex, body, weight):
#         self.weight = weight
#         self.body = body
#         self.category = category
#         self.sex = sex
#
#     def fire(self,s):
#         print('生火材料：',s)
#
#     def stu(self,l):
#         print('学习事物',l)

#
# 系统编程二：
# 打电话业务逻辑
# 人类：
# 属性:
# 姓名，性别，年龄，所拥有的手机剩余话费，手机品牌，手机电池容量，手机屏幕大小，手机最大待机时长，所拥有的积分。
# 功能：
# 发短信（要求参数传入短信内容）。
# 打电话（要求传入要打的电话号码和要打的时间长度。程序里判断号码是否为空或者本人的话费是否小于1元，
# 若为空或者小于1元则报相对应的错误信息，否则的话拨通。
# 结束后，按照时间长度扣费并返回扣费并且按照分钟给手机卡累加积分
# （0~10分钟：1元/钟、15个积分/钟，10~20分钟：0.8元/钟、39个积分/钟，其他：0.65元/钟、48个积分/钟））

# class Human:
#     def __init__(self, name, gender, age, balance, brand, battery_capacity, screen_size, max_standby_time, points):
#         self.name = name
#         self.gender = gender
#         self.age = age
#         self.balance = balance
#         self.battery_capacity = battery_capacity
#         self.screen_size = screen_size
#         self.standby_time = standby_time
#         self.points = points
#
#     def send_message(self, message_content):
#         # 发短信功能
#         print(f"{self.name} 发送短信: {message_content}")
#
#     def make_call(self, phone_number, duration):
#         # 打电话功能
#         if not phone_number:
#             return "错误: 电话号码不能为空。"
#         if self.balance < 1:
#             return "错误: 话费不足，无法拨打电话。"
#
#         # 计算费用和积分
#         if duration <= 10:
#             cost_per_minute = 1
#             points_per_minute = 15
#         elif duration <= 20:
#             cost_per_minute = 0.8
#             points_per_minute = 39
#         else:
#             cost_per_minute = 0.65
#             points_per_minute = 48
#
#         total_cost = cost_per_minute * duration
#         total_points = points_per_minute * duration
#
#         if self.balance < total_cost:
#             return "错误: 话费不足，无法拨打电话。"
#
#         self.balance -= total_cost
#         self.points += total_points
#
#         return f"拨打电话成功: {phone_number}，耗时: {duration}分钟，扣费: {total_cost}元，累计积分: {total_points}分。"
#
#
# human = Human("小明", "男", 20, 20, "华为", 4000, 6.1, 48, 100)
# print(human.make_call("123456789", 15))
